package org.sl.flvplayer.main {
	import org.sl.flvplayer.data.InitData;

	import flash.display.MovieClip;

	/**
	 * This is the main class which sole purpose is to initialize the player and to pass the flashVars to the InitData class.
	 * 
	 * @package org.sl.flvplayer.main
	 * @author Dan
	 * @version 
	 * @see org.sl.flvplayer.data.InitData
	 * @see org.sl.flvplayer.controls.PlayerLogic
	 */ 
	public class FLVPlayerApplication extends MovieClip {	

		private static var instance : FLVPlayerApplication;

	 // Socket Output Server for debugging purposes
  	    public static const SOS_TRACER : SOS = new SOS();

		/**
		 * Main instance.
		 * 	
		 * @return instance of the <code>FLVPlayerApplication</code> class 
		 */	 	
		public static function getInstance() : FLVPlayerApplication {
			return instance;
		}

		/**	
		 * Loads the flashVars and passes them to the init method of the InitData class.
		 */		
		public function FLVPlayerApplication() {
			instance = this;		
			// root`s loaderInfo parameters property
			var params : Object = loaderInfo.parameters;	
			// for testing purposes 			
			// params["playlist"] = "PlayList.xml";	
			InitData.getInstance().init(params);
		}
	}
}
